import api from './api';

// 获取小工具列表
export const getToolList = async () => {
  return api.get('/tool/list');
};

// 万年历查询
export const queryCalendar = async (date?: string) => {
  return api.get('/tool/calendar', { params: { date } });
};

// 星座查询
export const queryConstellation = async (code?: string) => {
  return api.get('/tool/constellation', { params: { code } });
};

// 生肖查询
export const queryChineseZodiac = async (code?: string) => {
  return api.get('/tool/chinese-zodiac', { params: { code } });
};

// 周公解梦
export const queryDream = async (keyword: string) => {
  return api.get('/tool/dream', { params: { keyword } });
};

// 姓名测算
export const nameAnalysis = async (data: {
  name: string;
  gender: number;
}) => {
  return api.post('/tool/name-analysis', data);
};

// 获取姓名测算详细分析（付费内容）
export const getNameAnalysisDetail = async (analysisId: number) => {
  return api.get(`/tool/name-analysis/${analysisId}/detail`);
};
